<script setup lang="ts">
import { Container } from "typedi";
import { esi } from "../../repositories";
import { AuthService } from "../../repositories/AuthService";
import type { Token } from "@scvzerng/esi-163";

const authService = Container.get(AuthService);

const contracts = async () => {
  const roles = await authService.getAuthRoles();
  const role = roles[0];
  const token = await authService.getAccessToken(role);
  await esi.contracts.personalContracts({ access_token: token } as Token, role.id);
};
defineOptions({
  name: "Home",
});
</script>

<template>
  <div>
    <el-button @click="contracts">合同</el-button>
  </div>
</template>

<style scoped></style>
